//
//  RSI.h
//  Chart
//
//  Created by CaoJun on 13-7-15.
//
//

#ifndef __Chart__RSI__
#define __Chart__RSI__

#include "IndexData.h"

#include <utility>
#include <string>
#include <vector>

namespace ytx {
    class RSI : public IndexData{
    public:
        double penultimateUPAVGN;
        double penultimateDNAVGN;
        double penultimateUPAVGM;
        double penultimateDNAVGM;
        RSI(IndexConfig indexConfig);
        virtual ~RSI();

        virtual std::string getCrosshairYData(int index);
        virtual int getDataLength() const;
        
        virtual void calculate(Quotation * data);
        
        virtual void updateLastest(Quotation * data);
        
        virtual bool hasData() const;
        virtual bool hasData(int index) const;
        virtual std::pair<double, double> getAdjustedDataMinMax(const Rectangle & rect) const;
        virtual std::vector<std::pair<double, std::string> > getLeftSideText(int startIndex, int endIndex, const Rectangle & rect, const Style & style) const;
        virtual std::vector<std::pair<std::string, std::string> > getTopSideText(int index) const;
    };
}

#endif /* defined(__Chart__RSI__) */
